package remato.domain.server.ejb;

import static javax.persistence.GenerationType.AUTO;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;

import remato.domain.common.PropertyDef;
import remato.domain.common.impl.PropertyValueImpl;

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class PropertyValueEjb extends PropertyValueImpl {
	
	@Override
	@Id
	@GeneratedValue(strategy=AUTO)
	public Long getDbId() {
		return super.getDbId();
	}
	
	@Override
	@ManyToOne(targetEntity = PropertyDefEjb.class)
	public PropertyDef getPropertyDef() {
		return super.getPropertyDef();
	}

	@Override
	@Lob
	public String getValue() {
		return super.getValue();
	}

	/**
	 * Needed to trigger CGLib proxy (ie. if other CGLib-proxies is used as 
	 * parameter.)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		return super.equals(obj);
	}

}
